pub fn convert_base(num_str: &str, to_base: u32) -> String {
    let parts: Vec<&str> = num_str.split('(').collect();
    let num_part = parts[0]; // 输入的数字
    let from_base_str = parts[1].trim_end_matches(')');
    let from_base: u32 = from_base_str.parse().unwrap(); // 输入的进制
    let num_in_decimal = u32::from_str_radix(num_part, from_base).unwrap();
    let mut result = String::new();
    let mut n = num_in_decimal;
    while n > 0 {
        let digit = n % to_base;
        let char_digit = if digit < 10 {
            ('0' as u8 + digit as u8) as char
        } else {
            ('a' as u8 + (digit - 10) as u8) as char
        };
        result.insert(0, char_digit);
        n /= to_base;
    }
    if result.is_empty() {
        result.push('0');
    }
    result
}
